package com.wanmait.recruit.service.impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.recruit.service.SchoolService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import com.wanmait.recruit.pojo.School;
import com.wanmait.recruit.mapper.SchoolMapper;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class SchoolServiceImpl implements SchoolService {

    @Resource
    private SchoolMapper schoolMapper;

    public int deleteByPrimaryKey(Integer id){
        return schoolMapper.deleteByPrimaryKey(id);
    }

    public void insert(School record){

    }

    @Override
    public void delete(School object) {

    }

    @Override
    public void update(School object) {

    }

    @Override
    public PageInfo<School> search(int pageNum, int pageSize) {
        return null;
    }

    public int insertSelective(School record){
        return schoolMapper.insertSelective(record);
    }

    public School selectByPrimaryKey(Integer id){
        return schoolMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKeySelective(School record){
        return schoolMapper.updateByPrimaryKeySelective(record);
    }

    public int updateByPrimaryKey(School record){
        return schoolMapper.updateByPrimaryKey(record);
    }

    @Override
    public String selectNameById(Integer id) {
        School school = schoolMapper.selectByPrimaryKey(id);
        return school.getSchoolName();
    }

    @Override
    public ArrayList<School> selectFindAll() {
        return schoolMapper.selectAll();
    }
}
